package com.zigong.app.beans;

import android.support.annotation.NonNull;
import android.text.TextUtils;

import com.ruihang.generalibrary.ui.util.IListData;
import com.ruihang.generalibrary.utils.IDataDate;
import com.zigong.app.ui.datainf.IAdvanceData;
import com.zigong.app.ui.util.IListShowData;

import org.xutils.db.annotation.Column;
import org.xutils.db.annotation.Table;

import java.io.Serializable;
import java.sql.Date;

/**
 * Created by Administrator on 2017/6/22 0022.
 */
@Table(name = "FSubscribe")
public class FSubscribe implements IListShowData,IAdvanceData, Serializable, IDataDate {
    @Column(name = "liveId", autoGen = false, isId = true)
    private String liveId;
    @Column(name = "liveImage")
    private String liveImage;
    @Column(name = "liveSource")
    private String liveSource;
    @Column(name = "liveTime")
    private String liveTime;
    @Column(name = "liveTitle")
    private String liveTitle;
    @Column(name = "liveUrl")
    private String liveUrl;
    @Column(name = "isSubscribe")
    private boolean isSubscribe;
    @Column(name = "liveContentUrl")
    private String liveContentUrl;
    private int pageAll;
    private int pageIndex;

    private Date dateTemp;

    @Override
    public String getDataTitle() {
        return liveTitle;
    }

    @Override
    public String getDataImg() {
        return liveImage;
    }

    @Override
    public String getDataTag() {
        return liveSource;
    }

    @Override
    public String getDataId() {
        return liveId;
    }

    @Override
    public int getDataType() {
        return 0;
    }

    @Override
    public int getDataViewType() {
        return 0;
    }

    @Override
    public IListData getOwner() {
        return null;
    }

    @Override
    public boolean isSubscribe() {
        return isSubscribe;
    }

    @Override
    public String getTime() {
        return liveTime;
    }

    public String getLiveId() {
        return liveId;
    }

    public void setLiveId(String liveId) {
        this.liveId = liveId;
    }

    public String getLiveImage() {
        return liveImage;
    }

    public void setLiveImage(String liveImage) {
        this.liveImage = liveImage;
    }

    public String getLiveSource() {
        return liveSource;
    }

    public void setLiveSource(String liveSource) {
        this.liveSource = liveSource;
    }

    public String getLiveTime() {
        return liveTime;
    }

    public void setLiveTime(String liveTime) {
        if (!TextUtils.equals(liveTime, this.liveTime)) {
            dateTemp = null;
        }
        this.liveTime = liveTime;
    }

    public String getLiveTitle() {
        return liveTitle;
    }

    public void setLiveTitle(String liveTitle) {
        this.liveTitle = liveTitle;
    }

    public String getLiveContentUrl() {
        return liveContentUrl;
    }

    public void setLiveContentUrl(String liveContentUrl) {
        this.liveContentUrl = liveContentUrl;
    }

    public String getLiveUrl() {
        return liveUrl;
    }

    public void setLiveUrl(String liveUrl) {
        this.liveUrl = liveUrl;
    }

    public void setSubscribe(boolean subscribe) {
        isSubscribe = subscribe;
    }

    public int getPageAll() {
        return pageAll;
    }

    public void setPageAll(int pageAll) {
        this.pageAll = pageAll;
    }

    public int getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public Date getDateTemp() {
        return dateTemp;
    }

    public void setDateTemp(Date dateTemp) {
        this.dateTemp = dateTemp;
    }
    @Override
    public Date getDataDate() {
        return dateTemp;
    }

    @Override
    public void setDataDate(Date date) {
    }

    @Override
    public IListShowData getOwenerData() {
        return null;
    }

    @NonNull
    @Override
    public String getDatePattern() {
        return "yyyy-MM-dd HH:mm:ss";
    }

    @Override
    public String getDateString() {
        return liveTime;
    }

    @Override
    public String toString() {
        return "FSubscribe{" +
                "liveId='" + liveId + '\'' +
                ", liveImage='" + liveImage + '\'' +
                ", liveSource='" + liveSource + '\'' +
                ", liveTime='" + liveTime + '\'' +
                ", liveTitle='" + liveTitle + '\'' +
                ", liveUrl='" + liveUrl + '\'' +
                ", isSubscribe=" + isSubscribe +
                ", pageAll=" + pageAll +
                ", pageIndex=" + pageIndex +
                ", dateTemp=" + dateTemp +
                '}';
    }
}
